package db

import (
	//"common/goredis"
	"common/logging"
	"iot/iot_app_server/app/util"
)

func GetDeviceStatus(deviceid string) (bool, error) {
	sessionid, err := util.GetDeviceSessionid(deviceid)
	if err != nil {
		logging.Error("GetDeviceStatus redis_handle.get failed,deviceid=%s, err: %s", deviceid, err.Error())
		return false, err
	}
	//设备不在线
	if string(sessionid) == "" {
		return false, nil
	}
	return true, nil
}
